package com.sunda.spmsweb.util;

import lombok.extern.slf4j.Slf4j;

import java.util.UUID;

/**
 * @program: spms
 * @description: create oversea data
 * @author: Wayne Wu
 * @create: 2021-08-20 16:02
 **/
@Slf4j
public class createOverseaData {

    /**
     * 海外常用工厂仓库信息：GF02  2006；TF02  1006；ZM61  1004；
     * 装箱单号：SPL10000001
     * 交货单号：2000000001
     * 柜号：TGBU5570001
     * 物料编号	210008389	210008387	210008384	210051422	210051375	210053126	210052745	210022233	210037994
     * 基本单位	PCS	PCS	PCS	PCS	PCS	PCS	PCS	PCS	PCS
     * @param args
     */

    public static void main(String[] args) {
        int cabinetNumberAuto = 5570001;
        int deliveryNoteAuto = 2000000001;
        int packageListAuto = 10000001;
        long boxNoteAuto = 12345670001L;
        for (; packageListAuto < 10000051; packageListAuto++){
            String uuid1 = UUID.randomUUID().toString().toLowerCase().replaceAll("-", "");
            String uuid2 = UUID.randomUUID().toString().toLowerCase().replaceAll("-", "");
            String uuid3 = UUID.randomUUID().toString().toLowerCase().replaceAll("-", "");
            String packageList = "SPL" + packageListAuto;

            String cabinetNumber1 = "TGBU" + cabinetNumberAuto;
            String cabinetNumber2 = "TGBU" + (cabinetNumberAuto + 1);

            String deliveryNote1 = String.valueOf(deliveryNoteAuto);
            String deliveryNote2 = String.valueOf(deliveryNoteAuto + 1);
            String deliveryNote3 = String.valueOf(deliveryNoteAuto + 2);

            String boxNote1 = "SP-" + (boxNoteAuto) + "-0101";
            String boxNote2 = "SP-" + (boxNoteAuto + 1) + "-0101";
            String boxNote3 = "SP-" + (boxNoteAuto + 2) + "-0103";
            String boxNote4 = "SP-" + (boxNoteAuto + 2) + "-0203";
            String boxNote5 = "SP-" + (boxNoteAuto + 2) + "-0303";
            String boxNote6 = "SP-" + (boxNoteAuto + 3) + "-0101";

//            System.out.println("========= 1.海外仓收货装箱单表 =========");
//            System.out.println(uuid1 + "  " + packageList + "  " + cabinetNumber1 + "  " + deliveryNote1 + "  " + "GF02");
//            System.out.println(uuid2 + "  " + packageList + "  " + cabinetNumber2 + "  " + deliveryNote2 + "  " + "TF02");
//            System.out.println(uuid3 + "  " + packageList + "  " + cabinetNumber2 + "  " + deliveryNote3 + "  " + "ZM61");
            System.out.println("\n\nINSERT INTO OVERSEA_PACKAGE_LIST (UUID_PACKAGE_LIST, SAP_PACKAGE_LIST, SAP_DELIVERY_NOTE, WERKS_RECEIVE, WERKS_DELIVERY, MERCHANDISER, CABINET_MODEL, CABINET_NUMBER, FROM_PORT, TO_PORT) " +
                    "VALUES ('" + uuid1 + "', '" + packageList + "', '" + deliveryNote1 + "', 'GF02', 'CN01', 'Zhang San', '20GP', '" + cabinetNumber1 + "', 'CNFOC', 'GHTEM');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST (UUID_PACKAGE_LIST, SAP_PACKAGE_LIST, SAP_DELIVERY_NOTE, WERKS_RECEIVE, WERKS_DELIVERY, MERCHANDISER, CABINET_MODEL, CABINET_NUMBER, FROM_PORT, TO_PORT) " +
                    "VALUES ('" + uuid2 + "', '" + packageList + "', '" + deliveryNote2 + "', 'TF02', 'CN01', 'Zhang San', '20GP', '" + cabinetNumber2 + "', 'CNFOC', 'GHTEM');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST (UUID_PACKAGE_LIST, SAP_PACKAGE_LIST, SAP_DELIVERY_NOTE, WERKS_RECEIVE, WERKS_DELIVERY, MERCHANDISER, CABINET_MODEL, CABINET_NUMBER, FROM_PORT, TO_PORT) " +
                    "VALUES ('" + uuid3 + "', '" + packageList + "', '" + deliveryNote3 + "', 'ZM61', 'CN01', 'Zhang San', '20GP', '" + cabinetNumber2 + "', 'CNFOC', 'GHTEM');");

//            System.out.println("========== 2.海外仓收货明细表 ==========");
//            System.out.println(uuid1 + "  " + "10" + "  " + deliveryNote1 + "  " + "10" + "  " + packageList + "  " + "10" + "  " + "210008384" + "  " + "GF02" + "  " + "2006" + "  " + 30);
//            System.out.println(uuid1 + "  " + "20" + "  " + deliveryNote1 + "  " + "20" + "  " + packageList + "  " + "20" + "  " + "210008387" + "  " + "GF02" + "  " + "2006" + "  " + 45);
//            System.out.println(uuid1 + "  " + "30" + "  " + deliveryNote1 + "  " + "30" + "  " + packageList + "  " + "30" + "  " + "210008389" + "  " + "GF02" + "  " + "2006" + "  " + 15);
//            System.out.println(uuid2 + "  " + "40" + "  " + deliveryNote2 + "  " + "10" + "  " + packageList + "  " + "40" + "  " + "210022233" + "  " + "TF02" + "  " + "1006" + "  " + 40);
//            System.out.println(uuid2 + "  " + "50" + "  " + deliveryNote2 + "  " + "20" + "  " + packageList + "  " + "50" + "  " + "210037994" + "  " + "TF02" + "  " + "1006" + "  " + 25);
//            System.out.println(uuid2 + "  " + "60" + "  " + deliveryNote2 + "  " + "30" + "  " + packageList + "  " + "60" + "  " + "210051375" + "  " + "TF02" + "  " + "1006" + "  " + 35);
//            System.out.println(uuid3 + "  " + "70" + "  " + deliveryNote3 + "  " + "10" + "  " + packageList + "  " + "70" + "  " + "210051422" + "  " + "ZM61" + "  " + "1004" + "  " + 50);
//            System.out.println(uuid3 + "  " + "80" + "  " + deliveryNote3 + "  " + "20" + "  " + packageList + "  " + "80" + "  " + "210052745" + "  " + "ZM61" + "  " + "1004" + "  " + 75);
//            System.out.println(uuid3 + "  " + "90" + "  " + deliveryNote3 + "  " + "30" + "  " + packageList + "  " + "90" + "  " + "210053126" + "  " + "ZM61" + "  " + "1004" + "  " + 90);

            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid1 + "', '10', '" + deliveryNote1 + "', '10', '" + packageList + "', '10', '210008384', '30', 'PCS', '30', 'PCS', 'GF02', '2006');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid1 + "', '20', '" + deliveryNote1 + "', '20', '" + packageList + "', '20', '210008387', '45', 'PCS', '45', 'PCS', 'GF02', '2006');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid1 + "', '30', '" + deliveryNote1 + "', '30', '" + packageList + "', '30', '210008389', '15', 'PCS', '15', 'PCS', 'GF02', '2006');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid2 + "', '40', '" + deliveryNote2 + "', '10', '" + packageList + "', '40', '210022233', '40', 'PCS', '40', 'PCS', 'TF02', '1006');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid2 + "', '50', '" + deliveryNote2 + "', '20', '" + packageList + "', '50', '210037994', '25', 'PCS', '25', 'PCS', 'TF02', '1006');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid2 + "', '60', '" + deliveryNote2 + "', '30', '" + packageList + "', '60', '210051375', '35', 'PCS', '35', 'PCS', 'TF02', '1006');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid3 + "', '70', '" + deliveryNote3 + "', '10', '" + packageList + "', '70', '210051422', '50', 'PCS', '50', 'PCS', 'ZM61', '1004');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid3 + "', '80', '" + deliveryNote3 + "', '20', '" + packageList + "', '80', '210052745', '75', 'PCS', '75', 'PCS', 'ZM61', '1004');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_DTL (UUID_PACKAGE_LIST, ITEM_SPMS, SAP_DELIVERY_NOTE, SAP_DELIVERY_NOTE_ITEM, SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, MATERIAL_NO, RECEIVABLE_QTY_BASIC_UNIT, BASIC_UNIT, RECEIVABLE_QTY_UNIT_SALES, UNIT_SALES, WERKS, WHS_LOCATION_CODE) VALUES ('" + uuid3 + "', '90', '" + deliveryNote3 + "', '30', '" + packageList + "', '90', '210053126', '90', 'PCS', '90', 'PCS', 'ZM61', '1004');");


//            System.out.println("========== 3.海外仓收货装箱单箱码关系表 ===========");
//            System.out.println(packageList + "  " + "10" + "  " + boxNote1);
//            System.out.println(packageList + "  " + "20" + "  " + boxNote1);
//            System.out.println(packageList + "  " + "30" + "  " + boxNote2);
//            System.out.println(packageList + "  " + "40" + "  " + boxNote3);
//            System.out.println(packageList + "  " + "50" + "  " + boxNote4);
//            System.out.println(packageList + "  " + "60" + "  " + boxNote5);
//            System.out.println(packageList + "  " + "70" + "  " + boxNote6);
//            System.out.println(packageList + "  " + "80" + "  " + boxNote6);
//            System.out.println(packageList + "  " + "90" + "  " + boxNote6);
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '10', '" + boxNote1 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '20', '" + boxNote1 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '30', '" + boxNote2 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '40', '" + boxNote3 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '50', '" + boxNote4 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '60', '" + boxNote5 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '70', '" + boxNote6 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '80', '" + boxNote6 + "');");
            System.out.println("INSERT INTO OVERSEA_PACKAGE_LIST_BOX (SAP_PACKAGE_LIST, SAP_PACKAGE_LIST_ITEM, BOX_NOTE) VALUES ('" + packageList + "', '90', '" + boxNote6 + "');");

            cabinetNumberAuto += 2;
            deliveryNoteAuto += 3;
            boxNoteAuto += 4;
        }


    }



}
